
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWidget>

QT_BEGIN_NAMESPACE

QT_END_NAMESPACE

class QListWidgetItem;

class ArticleManager;
namespace Ui {
    class MainWindow;
}
class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void onArticleCreated(bool success, const QString& message);
    void onArticleUpdated(bool success, const QString& message);
    void onArticleListFetched(const QList<QJsonObject>& articles);
    void onArticleFetched(const QJsonObject& object);
    void onOperationFailed(const QString& error);

private slots:
    void on_artcle_list_filter_textChanged(const QString &arg1);
    void on_pb_create_clicked();

    void on_article_list_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);

    void slot_article_title_textChanged(const QString &arg1);
    void slot_article_content_textChanged();

    void on_pb_article_to_image_clicked();
    void on_action_article_to_image_triggered();

    void on_cb_wordwrap_stateChanged(int arg1);

private:
    Ui::MainWindow *ui;
    bool isFirst;
    
    ArticleManager *manager;
};

#endif // MAINWINDOW_H

